package com.sdry.mapper.approval;
import java.util.List;

import com.sdry.entity.ApprovalCustomEntity;
import com.sdry.entity.ApprovalEntity;
import com.sdry.entity.PageEntity;
import com.sdry.entity.agreement.Agreement;
import com.sdry.entity.approval.Approval;
import com.sdry.entity.approval.ApprovalExample;
import com.sdry.entity.approvalManagement.ApprovalDetail;
import com.sdry.entity.base.Department;
import com.sdry.entity.base.Staff;
/**
 * 
 * @ClassName ApprovalMapper
 * @Description 审批Mapper
 * @Author lz
 * @Date 2018年9月3日 13:47:42
 * @Version 1.0
 */
public interface ApprovalMapper {
		/**
		 * 分页查询所有待审批
		 * @param pageEntity
		 * @return
		 */
		List<ApprovalCustomEntity> queryAllApproval(PageEntity pageEntity);

		/**
		 * 分页查询所有待审批条数
		 * @param pageEntity
		 * @return
		 */
		Long queryAllApprovalCount(PageEntity pageEntity);
		
		/**
		 * 插入提交审批信息
		 * @param approval
		 * @return
		 */
		Integer insertDept(ApprovalEntity approval);
		
		/**
		 * 查询所有部门：下拉框显示
		 * @return
		 */
		List<Department> queryAllDept();
		
		int countByExample(ApprovalExample example);

	    List<Approval> selectByExample(ApprovalExample example);
	    
	    ApprovalEntity findApprovalEntityByID(long approvalId);
	    
	    Integer setStatus(ApprovalEntity approvalEntity);
	    
	    List<Agreement> queryHTMLByAppId(String approvalId);
	    
	    /**
	     * 打印表单
	     * @param approvalId
	     * @return
	     */
		ApprovalDetail selectForm(String approvalId);

		ApprovalEntity findById(Long approvalId);
		
		public int deleteByid(Long approvalId);

		String queryFieldTypeByFieldNameArr(String fieldNameArr);

		List<Staff> queryPeopleByDept(Long did);

		List<Agreement> selectAgreementByApprovalId(String aremark);

		List<Agreement> selectAgreementByAremark2(String aremark);
}
